﻿<%@ Page Language="C#" EnableEventValidation ="false"  AutoEventWireup="true" CodeFile="User_Group_Edit.aspx.cs" Inherits="SysManage_UserManage_User_Group_Edit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
 <title>用户组编辑</title>
    <base target ="_self" />
        <link rel="stylesheet" href="../../css/css.css"  type="text/css" />
    <!--#include file="../../JS/KeyControlCode.js"-->
    <!--#include file="../../JS/TrimData.js"--> 
    <!--#include file="../../JS/TDTextBoxControl.js"-->
    <script language ="javascript" type ="text/javascript" >
     <!--
      //选择人员信息
      var sChoiceID;              //所在赋值的关键字  
      var ChoiceNameInfo;         //选择的名称集合
      var ChoiceIDInfo;           //选择的ID集合
      var iChoicePoNumber2 =0;     //0表示任意多,其它的正整数为可以选择的最大个数.不可以为负数
      function GetMyPersTree(obj)
      {
         var sOrgIDCol = form1.HOrgIDCol.value;
         var sFeatures = "dialogHeight:600px;dialogWidth:700px;resizeable:no;help:no;status:no";
         var obj = showModalDialog("../ChoicePersInfo.aspx?ChoiceID="+obj+"&OrgType=2&OrgIDCol="+sOrgIDCol,window,sFeatures);
         if(obj != undefined)
         {
             sChoiceID = obj.sChoiceID;
             ChoiceNameInfo = obj.ChoiceNameInfo;
             ChoiceIDInfo=obj.ChoiceIDInfo;
             eval("form1.ChoiceName_"+sChoiceID+".value="+ChoiceNameInfo+";");
             eval("form1.HChoiceID_"+sChoiceID+".value="+ChoiceIDInfo+";"); 
             eval("form1.ChoiceName_"+sChoiceID+".blur()");
         }
      }
      -->
    </script> 
        <script language="javascript" type="text/javascript">     
     function matchStationId(obj)
			{
				SysManage_UserManage_User_Group_Edit.getMatchStation(obj,CallBack);
			}
			function CallBack(response)
			{
				var matchddl = form1.DbRoleName;
				matchddl.options.length = 0;
				if(response.value!=null )
				{
					for(var i=0;i<response.value.length;++i)
					{
						var arry=response.value[i].split("|")
						var no = new Option();						
						no.value = arry[0];
						no.text = arry[1];
						matchddl.options.add(no);
						if(i==0)
						{
						    form1.HAjaxDropID.value = arry[0];
						}
					}
				}
			}			
			function selectthis(sel1)
			{
				form1.HAjaxDropID.value = sel1.options[sel1.selectedIndex].value;
			}
    </script> 

</head>
<body leftmargin ="0" rightmargin ="0" topmargin ="0"  style =" background-image :url('../../images/hit_bg.gif');"> 
<% 
  Response .ExpiresAbsolute=System.DateTime.Now. AddSeconds(-1);
  Response.Expires=0;
  Response.CacheControl = "no-cache";
%>
    <form id="form1" method ="post" runat="server">
    <input type="hidden" id="HOrgIDCol" runat ="server"  />
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="15%" height="18" valign="top" background="../../images/tablelb.gif" class="font13"> 
      <div align="left"><img height="18" src="../../images/tablelbleft.gif" width=18></div></td>
    <td width="2%" valign="top" background="../../images/tablelb.gif" bgcolor="#ffffff" class="font13"> 
      <div align="right"><img height="18" src="../../images/tablelbright.gif" width=12></div></td>
    <td colspan="2" valign="center" bgcolor="#ffffff" class="font13"> <div align="right"> 
      </div></td>
  </tr>
  <tr> 
    <td height="26" colspan="2" valign="center" bgcolor="#e9ecf5" class="font13"> 
      <div align="center">用户组管理</div></td>
    <td width="80%" height="26" valign="bottom" background="../../images/tddi.gif" class="font13"> 
      <div align="right"> </div></td>
    <td width="3%" valign="top" background="../../images/tddi.gif" class="font13"> 
      <div align="right"><img height="26" src="../../images/tddir.gif"></div></td>
  </tr>
</table>
<table width="98%" height="107" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#e9ecf5">
  <tr> 
    <td height="147"  valign="top"> 
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="tablelsdi">
          <tr> 
            <td width="4%" background="../../images/tablelb01.gif"><img src="../../images/tablelb01-left.gif" width="21" height="22"></td>
            <td width="82%" background="../../images/tablelb01.gif" class="font12w">用户组编辑</td>
            <td width="14%" background="../../images/tablelb01.gif"> <div align="right"><img src="../../images/tablelb01-right.gif" width="21" height="22"></div></td>
          </tr>
        </table>
    <table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" class="tablelb" style ="border-collapse :collapse ;">
      <tr style ="height :26px;">
        <td style ="width :15%;" bgcolor="#ECF4FD" class="tableleft"  align ="right"><label id="sjzx" runat ="server"  >上级用户组</label>&nbsp;</td>
        <td style ="width :35%;" bgcolor="#ECF4FD" class="tableleft">
         <asp:DropDownList ID="DropGroupID" TabIndex ="2" DataValueField ="GroupID"  DataTextField ="GroupName" runat="server" ></asp:DropDownList>
         </td>
        <td style ="width :15%;" width="20%" bgcolor="#ECF4FD" class="tableleft" align ="right" >用户组编码&nbsp;</td>
        <td style="width :35%;" bgcolor="#ECF4FD" class="tableleft">
        <asp:TextBox ID="GroupID" Width ="140" runat ="server" TabIndex ="2" MaxLength ="40"  onkeydown = "Number(this)"></asp:TextBox>
        <asp:Label ID="tishi1" runat ="server" Text ="*" ForeColor="Red"></asp:Label></td>
      </tr>
      <tr style ="height :26px;">
        <td bgcolor="#E1EEFD" class="tableleft" align ="right" >用户组名称&nbsp;</td>
        <td bgcolor="#E1EEFD" class="tableleft"><asp:TextBox ID="GroupName" Width ="140" runat ="server" TabIndex ="3"></asp:TextBox><asp:Label ID="Label2" runat ="server" Text ="*" ForeColor="Red"></asp:Label></td>
        <td bgcolor="#E1EEFD" class="tableleft" align ="right" >排序号&nbsp;</td>
        <td bgcolor="#E1EEFD" class="tableleft"><asp:TextBox ID="GOrder" Width ="140" MaxLength ="8" onkeyup="JudgeIsNaN(this)" runat ="server" TabIndex ="4"  ></asp:TextBox></td>
      </tr>
      <tr style ="height :26px;">
        <td bgcolor="#ECF4FD" class="tableleft"  align ="right">功能角色&nbsp;</td>
        <td bgcolor="#ECF4FD" class="tableleft"><asp:DropDownList ID="RoleName" DataValueField ="Code"  DataTextField ="Name" runat="server" Enabled="False" ></asp:DropDownList></td>
        <td bgcolor="#ECF4FD" class="tableleft"  align ="right">数据角色&nbsp;</td>
        <td bgcolor="#ECF4FD" class="tableleft"><asp:DropDownList ID="DbRoleName" DataValueField ="Role_Code"  DataTextField ="Role_Name" onchange="selectthis(this)"  runat="server" Enabled="False" ></asp:DropDownList></td>
      </tr>
      <tr style ="height :26px;">
        <td bgcolor="#E1EEFD" class="tableleft" align ="right"><label id="Label1"  onclick ="GetMyPersTree(2)" runat ="server"  >所属用户</label> </td>
        <td bgcolor="#E1EEFD" class="tableleft">
          <asp:TextBox ID="ChoiceName_2" runat ="server" TabIndex ="5" TextMode ="multiLine" Rows ="3" Columns ="20"  onclick ="GetMyPersTree(2)"></asp:TextBox>
          <input type="hidden" id="HChoiceID_2" runat ="server" />
           </td>
        <td bgcolor="#E1EEFD" class="tableleft"  align ="right">是否有效&nbsp;</td>
        <td bgcolor="#E1EEFD" class="tableleft">
           <asp:dropdownlist id="Effective" tabIndex="6" runat="server" Enabled="true" Width="60px">
			 <asp:ListItem Value="1" Selected ="true" >是</asp:ListItem>
			 <asp:ListItem Value="0">否</asp:ListItem>
		  </asp:dropdownlist>
        </td>
       </tr>
       </table>       
      <table  width="95%" border="0" cellpadding="5" cellspacing="0" align="center" >
      <tr><td width="20%"></td>
        <td>
            <input id="GrantBtn1" type="submit" runat ="server" class ="button03" tabindex ="8" value ="提交(S)" accesskey ="s" onserverclick="GrantBtn1_ServerClick" /> &nbsp;&nbsp;
            <input type ="button" id="backBtn" value ="返回(C)" accesskey ="c"  class="button03" tabindex ="9" onclick ="window.close();" /></td>
      </tr>
    </table>
    <input type="hidden" id="hOrgID1" runat ="server"  />
    <input type="hidden" id="hNewOrgID1" runat ="server" />
    <input type="hidden" id="hOldOrgName" runat ="server" />
          <input type="hidden" id="hOldParentID1" runat ="server"  />
          <input type="hidden" id="hNewParentID1" runat ="server"  />
          <input type="hidden" id="hidEditType" runat ="server" />
          <input type="hidden" id="hEffective" runat ="server" />
          <input type="hidden" id="hPersID1" runat ="server" />          
          <input type="hidden" id="NewPersID1" runat="server" />
          <input type="hidden" id="HOrgType" runat ="server"  />
          <input type="hidden" id="hAutoID" runat ="server" />
          <input type="hidden" id="HGroupID" runat ="server"  />
          <input type="hidden" id="HAjaxDropID" runat ="server" />
    </form>
    <script language ="javascript" type ="text/javascript" >
     <!--     
      //人员选择
     -->
    </script>
    
    <script language ="javascript" type="text/javascript" >
    function jsTrim(str)
    {
    return str.replace(/(^\s*)|(\s*$)/g, ""); 
    }
    <!--
      var sData = dialogArguments;
      form1.hidEditType.value = sData.stype ;
      var sobj = sData.RoleForm.Hcode.value;  
      var ary=sobj.split('^');
      if(sData.stype == "2")  // 2 修改 1 新建
      {
       /* var PName = "";
        if(trim(ary[3]) == "" || trim(ary[3]) == null)
        {
          PName = "顶级结点";
        }
        else
        {
          PName = trim(ary[3]);
        }
        form1.ChoiceName_1.value = PName;
        form1.HChoiceID_1.value = trim(ary[2]);*/
        form1.DropGroupID.value = trim(ary[2]);
        form1.GroupID.value = trim(ary[0]);
        form1.HGroupID.value = trim(ary[0]);
        form1.GroupName.value = trim(ary[1]);
        form1.GOrder.value = trim(ary[8]);
        form1.ChoiceName_2.value = trim(ary[7]);
        form1.HChoiceID_2.value = trim(ary[6]);        
        form1.Effective.value = trim(ary[11]);
        form1.hAutoID.value = trim(ary[12]);
        form1.RoleName.options.value =jsTrim(ary[13]);; // trim(ary[13]);


        form1.DbRoleName.value = jsTrim(ary[14]);
    
      }
      else if(sData.stype == "1")
       {
         /* if(trim(ary[1]) == "" || trim(ary[1]) == null || trim(ary[1]) == "undefined")          
          {
            form1.ChoiceName_1.value = "顶级结点";
          }
          else
          {
            form1.ChoiceName_1.value = trim(ary[1]);
            form1.HChoiceID_1.value = trim(ary[0]);
          }*/
          if(trim(ary[0]) == "")
          {
            form1.DropGroupID.value ="0";
          }
          else
          {
            form1.DropGroupID.value = trim(ary[0]);
          }  
       }       
   -->
    </script>    
</body>
</html>
